package Message;

public class Message {
    private int actionCommand;
    private int serviceType;
    private BufferData buffer;

    public Message() {
        buffer = new BufferData();
    }

    public Message(int actionCommand, int serviceType) {
        this.actionCommand = actionCommand;
        this.serviceType = serviceType;
        buffer = new BufferData();
    }

    Message(int actionCommand, int serviceType, byte[] data) {
        this.actionCommand = actionCommand;
        this.serviceType = serviceType;
        buffer = new BufferData(data);
    }

    public int getActionCommand() {
        return actionCommand;
    }

    public void setActionCommand(int type) {
        this.actionCommand = type;
    }

    public BufferData getBuffer() {
        return buffer;
    }

    public void setBuffer(BufferData buffer) {
        this.buffer = buffer;
    }

    public int getServiceType() {
        return serviceType;
    }

    public void setServiceType(int serverServiceType) {
        this.serviceType = serverServiceType;
    }

    public boolean isDataAvailable() {
        return (buffer.getPosition() < buffer.getLength());
    }
    
}
